from flask import render_template, redirect, url_for, request, flash
from flask_login import login_required, current_user
from routes import main_bp

# 首页
@main_bp.route('/')
@login_required
def index():
    if current_user.role == 'employee':
        return render_template('employee/index.html')
    else:
        return render_template('admin/index.html')

# 员工考勤页
@main_bp.route('/employee/attendances')
@login_required
def employee_attendances():
    return render_template('employee/attendances.html')

# 员工绩效页
@main_bp.route('/employee/performances')
@login_required
def employee_performances():
    return render_template('employee/performances.html')

# 员工个人中心页
@main_bp.route('/employee/profile')
@login_required
def employee_profile():
    return render_template('employee/profile.html')

# 管理员员工管理页
@main_bp.route('/admin/employees')
@login_required
def admin_employees():
    return render_template('admin/employees.html')

# 管理员部门管理页
@main_bp.route('/admin/departments')
@login_required
def admin_departments():
    return render_template('admin/departments.html')

# 管理员考勤管理页
@main_bp.route('/admin/attendances')
@login_required
def admin_attendances():
    return render_template('admin/attendances.html')
    
# 管理员绩效管理页
@main_bp.route('/admin/performances')
@login_required
def admin_performances():
    return render_template('admin/performances.html')

# 管理员个人中心页
@main_bp.route('/admin/profile')
@login_required
def admin_profile():
    return render_template('admin/profile.html')

# 管理员AI助手页
@main_bp.route('/admin/ai-assistant')
@login_required
def admin_ai_assistant():
    return render_template('admin/ai-assistant.html')

# 员工AI助手页
@main_bp.route('/employee/ai-assistant')
@login_required
def employee_ai_assistant():
    return render_template('employee/ai-assistant.html')